import instance from './http'
//注册
export const registerApi=(username,password)=>{
    return instance({
        url:'http://localhost:12345/api/user/register',
        method:'POST',
        data:{
            username,
            password,
        }
    })
}
//登录
export const loginApi=(username,password)=>{
    return instance({
        url:'http://localhost:12345/api/user/login',
        method:'POST',
        data:{
            username,
            password,
        }
    })
}
//搜索
export const searchApi=(query)=>{
    return instance({
        url:'https://api-hmugo-web.itheima.net/api/public/v1/goods/qsearch',
        method:'GET',
        params:{
            query
        }
    })
}
//跳转详情
export const detailApi=(goods_id)=>{
    return instance({
        url:'https://api-hmugo-web.itheima.net/api/public/v1/goods/detail',
        method:'GET',
        params:{
            goods_id
        }
    })
}
// 封装首页导航 https://api-hmugo-web.itheima.net/api/public/v1/home/catitems
export const navigationApi=()=>{
    return instance({
        url:'https://api-hmugo-web.itheima.net/api/public/v1/home/catitems',
        method:'GET',
    })
}
// 封装楼层  https://api-hmugo-web.itheima.net/api/public/v1/home/floordata
export const floorApi=()=>{
    return instance({
        url:'https://api-hmugo-web.itheima.net/api/public/v1/home/floordata',
        method:'GET',
    })
}
// 封装分类 https://api-hmugo-web.itheima.net/api/public/v1/categories
export const classifApi=()=>{
    return instance({
        url:'https://api-hmugo-web.itheima.net/api/public/v1/categories',
        method:'GET',
    })
}
// 封装商品列表
export const goodsApi=(cid)=>{
    return instance({
        url:'https://api-hmugo-web.itheima.net/api/public/v1/goods/search',
        method:'GET',
    })
}